package com.geeguo.ebuilder.operation;

import com.geeguo.ebuilder.operation.runner.ApplicationStartupListener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;

@EnableDiscoveryClient
@ServletComponentScan
@SpringBootApplication(scanBasePackages = "com.geeguo.ebuilder")
public class EbuilderOperationApiApplication {

    public static void main(String[] args) {
        SpringApplication.run(EbuilderOperationApiApplication.class, args);
    }

    @Bean
    public ApplicationStartupListener appStartupListener() {
        return new ApplicationStartupListener();
    }

    /* 解决druid日志报错：discard long time none received connection. */
    static {
        System.setProperty("druid.mysql.usePingMethod", "false");
    }
}
